﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BankCodeMaintan.aspx.cs" Inherits="_1" MasterPageFile="~/MasterPage.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style4
        {
            text-align: center;
        }
        .style5
        {
            text-align: center;
            color: #FF0000;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <p class="style4">
        <b style="text-align: center">金融機構代碼維護</b></p>
    <p style="text-align: center">
        <asp:Button ID="queryData" runat="server" onclick="queryData_Click" Text="查詢" />
&nbsp;
        <asp:Button ID="insertData" runat="server" onclick="insertData_Click" 
            Text="新增" />
        <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id" 
            DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" 
            onrowediting="GridView1_RowEditing" AllowPaging="True" 
            onpageindexchanged="GridView1_PageIndexChanged" 
            onrowcancelingedit="GridView1_RowCancelingEdit" 
            onrowdeleting="GridView1_RowDeleting" PageSize="20" 
            onrowdatabound="GridView1_RowDataBound" 
            onrowupdated="GridView1_RowUpdated">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="FISC_BankType" HeaderText="FISC_BankType" 
                    SortExpression="FISC_BankType" />
                <asp:BoundField DataField="FISC_BankCode" HeaderText="FISC_BankCode" 
                    SortExpression="FISC_BankCode" />
                <asp:BoundField DataField="FISC_BankName" HeaderText="FISC_BankName" 
                    SortExpression="FISC_BankName" />
                <asp:BoundField DataField="Memo" HeaderText="Memo" SortExpression="Memo" />
                <asp:BoundField DataField="SummitCustID" HeaderText="SummitCustID" 
                    SortExpression="SummitCustID" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                執行結果： 
                <br />
                <span class="style5">您輸入的資料日期，目前查無符合資料！</span>
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FEIBConnectionString %>" 
            DeleteCommand="DELETE FROM [TR_BankingMap] WHERE [id] = @id" 
            InsertCommand="INSERT INTO [TR_BankingMap] ([FISC_BankType], [FISC_BankCode], [FISC_BankName], [Memo], [SummitCustID]) VALUES (@FISC_BankType, @FISC_BankCode, @FISC_BankName, @Memo, @SummitCustID)" 
            SelectCommand="SELECT * FROM [TR_BankingMap]" 
            
            UpdateCommand="UPDATE [TR_BankingMap] SET [FISC_BankType] = @FISC_BankType, [FISC_BankCode] = @FISC_BankCode, [FISC_BankName] = @FISC_BankName, [Memo] = @Memo, [SummitCustID] = @SummitCustID WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="FISC_BankType" Type="Int32" />
                <asp:Parameter Name="FISC_BankCode" Type="String" />
                <asp:Parameter Name="FISC_BankName" Type="String" />
                <asp:Parameter Name="Memo" Type="String" />
                <asp:Parameter Name="SummitCustID" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="FISC_BankType" Type="Int32" />
                <asp:Parameter Name="FISC_BankCode" Type="String" />
                <asp:Parameter Name="FISC_BankName" Type="String" />
                <asp:Parameter Name="Memo" Type="String" />
                <asp:Parameter Name="SummitCustID" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        <asp:FormView ID="FormView1" runat="server" DataKeyNames="id" 
            DataSourceID="SqlDataSource2" oniteminserted="FormView1_ItemInserted" 
            CellPadding="4" ForeColor="#333333">
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <EditItemTemplate>
                id:
                <asp:Label ID="idLabel1" runat="server" Text='<%# Eval("id") %>' />
                <br />
                FISC_BankType:
                <asp:TextBox ID="FISC_BankTypeTextBox" runat="server" 
                    Text='<%# Bind("FISC_BankType") %>' />
                <br />
                FISC_BankCode:
                <asp:TextBox ID="FISC_BankCodeTextBox" runat="server" 
                    Text='<%# Bind("FISC_BankCode") %>' />
                <br />
                FISC_BankName:
                <asp:TextBox ID="FISC_BankNameTextBox" runat="server" 
                    Text='<%# Bind("FISC_BankName") %>' />
                <br />
                Memo:
                <asp:TextBox ID="MemoTextBox" runat="server" Text='<%# Bind("Memo") %>' />
                <br />
                SummitCustID:
                <asp:TextBox ID="SummitCustIDTextBox" runat="server" 
                    Text='<%# Bind("SummitCustID") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="更新" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="取消" />
            </EditItemTemplate>
            <InsertItemTemplate>
                FISC_BankType:
                <asp:TextBox ID="FISC_BankTypeTextBox" runat="server" 
                    Text='<%# Bind("FISC_BankType") %>' />
                <br />
                FISC_BankCode:
                <asp:TextBox ID="FISC_BankCodeTextBox" runat="server" 
                    Text='<%# Bind("FISC_BankCode") %>' />
                <br />
                FISC_BankName:
                <asp:TextBox ID="FISC_BankNameTextBox" runat="server" 
                    Text='<%# Bind("FISC_BankName") %>' />
                <br />
                Memo:
                <asp:TextBox ID="MemoTextBox" runat="server" Text='<%# Bind("Memo") %>' />
                <br />
                SummitCustID:
                <asp:TextBox ID="SummitCustIDTextBox" runat="server" 
                    Text='<%# Bind("SummitCustID") %>' />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                    CommandName="Insert" Text="插入" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="取消" />
            </InsertItemTemplate>
            <ItemTemplate>
                id:
                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                <br />
                FISC_BankType:
                <asp:Label ID="FISC_BankTypeLabel" runat="server" 
                    Text='<%# Bind("FISC_BankType") %>' />
                <br />
                FISC_BankCode:
                <asp:Label ID="FISC_BankCodeLabel" runat="server" 
                    Text='<%# Bind("FISC_BankCode") %>' />
                <br />
                FISC_BankName:
                <asp:Label ID="FISC_BankNameLabel" runat="server" 
                    Text='<%# Bind("FISC_BankName") %>' />
                <br />
                Memo:
                <asp:Label ID="MemoLabel" runat="server" Text='<%# Bind("Memo") %>' />
                <br />
                SummitCustID:
                <asp:Label ID="SummitCustIDLabel" runat="server" 
                    Text='<%# Bind("SummitCustID") %>' />
                <br />
                <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                    CommandName="Edit" Text="編輯" />
                &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                    CommandName="Delete" Text="刪除" />
                &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                    CommandName="New" Text="新增" />
            </ItemTemplate>
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
        </asp:FormView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FEIBConnectionString %>" 
            DeleteCommand="DELETE FROM [TR_BankingMap] WHERE [id] = @id" 
            InsertCommand="INSERT INTO [TR_BankingMap] ([FISC_BankType], [FISC_BankCode], [FISC_BankName], [Memo], [SummitCustID]) VALUES (@FISC_BankType, @FISC_BankCode, @FISC_BankName, @Memo, @SummitCustID)" 
            SelectCommand="SELECT * FROM [TR_BankingMap]" 
            
            UpdateCommand="UPDATE [TR_BankingMap] SET [FISC_BankType] = @FISC_BankType, [FISC_BankCode] = @FISC_BankCode, [FISC_BankName] = @FISC_BankName, [Memo] = @Memo, [SummitCustID] = @SummitCustID WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="FISC_BankType" Type="Int32" />
                <asp:Parameter Name="FISC_BankCode" Type="String" />
                <asp:Parameter Name="FISC_BankName" Type="String" />
                <asp:Parameter Name="Memo" Type="String" />
                <asp:Parameter Name="SummitCustID" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="FISC_BankType" Type="Int32" />
                <asp:Parameter Name="FISC_BankCode" Type="String" />
                <asp:Parameter Name="FISC_BankName" Type="String" />
                <asp:Parameter Name="Memo" Type="String" />
                <asp:Parameter Name="SummitCustID" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
    </p>

</asp:Content>